﻿@page
@{
	ViewData["Title"] = "Register";
}
<div id="app" class="container-fluid" v-cloak>

	<div class="card-body register-card-body">
		<p class="login-box-msg">@ViewData["Title"]</p>

		<form v-on:submit.prevent="handleSubmit">
			<div class="input-group mb-3">
				<input id="Email"
					   name="Email"
					   type="email"
					   placeholder="Enter Email"
					   class="form-control"
					   v-model="state.email"
					   v-on:input="state.errors.email = ''">
				<div class="input-group-append">
					<div class="input-group-text">
						<span class="fas fa-envelope"></span>
					</div>
				</div>
			</div>
			<label v-if="state.errors.email" class="text-danger small">{{ state.errors.email }}</label>
			<div class="input-group mb-3">
				<input id="CompanyName"
					   name="CompanyName"
					   type="text"
					   placeholder="Enter Company Name"
					   class="form-control"
					   v-model="state.companyName">
				<div class="input-group-append">
					<div class="input-group-text">
						<span class="fas fa-edit"></span>
					</div>
				</div>
			</div>
			<div class="input-group mb-3">
				<input id="FirstName"
					   name="FirstName"
					   type="text"
					   placeholder="Enter First Name"
					   class="form-control"
					   v-model="state.firstName"
					   v-on:input="state.errors.firstName = ''">
				<div class="input-group-append">
					<div class="input-group-text">
						<span class="fas fa-edit"></span>
					</div>
				</div>
			</div>
			<label v-if="state.errors.firstName" class="text-danger small">{{ state.errors.firstName }}</label>
			<div class="input-group mb-3">
				<input id="LastName"
					   name="LastName"
					   type="text"
					   placeholder="Enter Last Name"
					   class="form-control"
					   v-model="state.lastName"
					   v-on:input="state.errors.lastName = ''">
				<div class="input-group-append">
					<div class="input-group-text">
						<span class="fas fa-edit"></span>
					</div>
				</div>
			</div>
			<label v-if="state.errors.lastName" class="text-danger small">{{ state.errors.lastName }}</label>
			<div class="input-group mb-3">
				<input id="Password"
					   name="Password"
					   type="password"
					   placeholder="Enter Password"
					   class="form-control"
					   v-model="state.password"
					   v-on:input="state.errors.password = ''">
				<div class="input-group-append">
					<div class="input-group-text">
						<span class="fas fa-lock"></span>
					</div>
				</div>
			</div>
			<label v-if="state.errors.password" class="text-danger small">{{ state.errors.password }}</label>
			<div class="input-group mb-3">
				<input id="ConfirmPassword"
					   name="ConfirmPassword"
					   type="password"
					   placeholder="Re-type Password"
					   class="form-control"
					   v-model="state.confirmPassword"
					   v-on:input="state.errors.confirmPassword = ''">
				<div class="input-group-append">
					<div class="input-group-text">
						<span class="fas fa-lock"></span>
					</div>
				</div>
			</div>
			<label v-if="state.errors.confirmPassword" class="text-danger small">{{ state.errors.confirmPassword }}</label>
			<div class="row">
				<div class="col-8">
					<div class="icheck-primary">
						<input type="checkbox">
						<label for="remember">
							Remember Me
						</label>
					</div>
				</div>
				<!-- /.col -->
				<div class="col-4">
					<button type="submit"
							v-bind:disabled="state.isSubmitting"
							class="btn btn-primary btn-block">
						<span class="spinner-border spinner-border-sm me-2"
							  v-if="state.isSubmitting"
							  role="status"
							  aria-hidden="true"></span>
						<span>{{ state.isSubmitting ? '...' : 'Register' }}</span>
					</button>
				</div>
				<!-- /.col -->
			</div>
		</form>

		<div class="social-auth-links text-center">
			<p>- OR -</p>
			<a href="#" class="btn btn-block btn-primary">
				<i class="fab fa-facebook mr-2"></i>
				Sign up using Facebook
			</a>
			<a href="#" class="btn btn-block btn-danger">
				<i class="fab fa-google-plus mr-2"></i>
				Sign up using Google+
			</a>
		</div>

		<p class="mb-1">
			<a asp-page="/Accounts/ForgotPassword">I forgot my password</a>
		</p>
		<p class="mb-1">
			<a asp-page="/Accounts/Login" class="text-center">I already have a membership</a>
		</p>
	</div>


</div>

@section scripts {
	<script type="module" src="~/FrontEnd/Pages/Accounts/Register.cshtml.js"></script>
}
